

#include "adv7611.h"

// Added Recommended Settings for non-fast switching scripts
void adv7611_adi_recommended_setting(void)
{
	adv7611_write(0x68, 0xC1, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC2, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC3, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC4, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC5, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC6, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC7, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC8, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC9, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xCA, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xCB, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xCC, 0x01); // ADI recommended setting
}

void adv7611_reset(void)
{
	//adv7611_write(0x98, 0xFF, 0x80); // I2C reset
	// 56 17 0x02); // Encoder reset
}

// :6-1e Port A, 720p,1080i Any Color Space In (YCrCb 444 24bit from ADV761x) 
void adv7611_720P_1080i(void)
{
	//adv7611_write(0x98, 0xFF, 0x80); // I2C reset
	adv7611_write(0x98, 0x01, 0x06); // Prim_Mode =110b HDMI-GR	60 Hz
	adv7611_write(0x98, 0x02, 0xF5); // Auto CSC, YCrCb out, Set op_656 bit
	//adv7611_write(0x98, 0x03, 0x40); // 24 bit SDR 444 Mode 0
	adv7611_write(0x98, 0x03, 0x2A); // 12-bit 4:2:2 DDR mode 2 (ITU-656 mode)
	adv7611_write(0x98, 0x05, 0x28); // AV Codes Off
	adv7611_write(0x98, 0x06, 0xA6); // Invert VS,HS pins
	adv7611_write(0x98, 0x0B, 0x44); // Power up part
	adv7611_write(0x98, 0x0C, 0x42); // Power up part
	adv7611_write(0x98, 0x14, 0x7F); // Max Drive Strength
	adv7611_write(0x98, 0x15, 0x80); // Disable Tristate of Pins
	adv7611_write(0x98, 0x19, 0x83); // LLC DLL phase
	adv7611_write(0x98, 0x33, 0x40); // LLC DLL enable
	adv7611_write(0x44, 0xBA, 0x01); // Set HDMI FreeRun
	adv7611_write(0x64, 0x40, 0x81); // Disable HDCP 1.1 features
	adv7611_write(0x68, 0x9B, 0x03); // ADI recommended setting
	adv7611_write(0x68, 0xC1, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC2, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC3, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC4, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC5, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC6, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC7, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC8, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC9, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xCA, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xCB, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xCC, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0x00, 0x00); // Set HDMI Input Port A
	adv7611_write(0x68, 0x83, 0xFE); // Enable clock terminator for port A
	adv7611_write(0x68, 0x6F, 0x0C); // ADI recommended setting
	adv7611_write(0x68, 0x85, 0x1F); // ADI recommended setting
	adv7611_write(0x68, 0x87, 0x70); // ADI recommended setting
	adv7611_write(0x68, 0x8D, 0x04); // LFG
	adv7611_write(0x68, 0x8E, 0x1E); // HFG
	adv7611_write(0x68, 0x1A, 0x8A); // unmute audio
	adv7611_write(0x68, 0x57, 0xDA); // ADI recommended setting
	adv7611_write(0x68, 0x58, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0x03, 0x98); // DIS_I2C_ZERO_COMPR
	adv7611_write(0x68, 0x75, 0x10); // DDC drive strength
}

// 6-1f Port A, 1080p Any Color Space In (YCrCb 444 24bit from ADV761x) 
void adv7611_1080P(void)
{
	//adv7611_write(0x98, 0xFF, 0x80); // I2C reset
	adv7611_write(0x98, 0xF4, 0x80); // CEC
	adv7611_write(0x98, 0xF5, 0x7C); // INFOFRAME
	adv7611_write(0x98, 0xF8, 0x4C); // DPLL
	adv7611_write(0x98, 0xF9, 0x64); // KSV
	adv7611_write(0x98, 0xFA, 0x6C); // EDID
	adv7611_write(0x98, 0xFB, 0x68); // HDMI
	adv7611_write(0x98, 0xFD, 0x44); // CP

	adv7611_write(0x98, 0x01, 0x06); // Prim_Mode =110b HDMI-GR
	adv7611_write(0x98, 0x02, 0xF2); // Auto CSC, YCrCb out, Set op_656 bit
	adv7611_write(0x98, 0x03, 0x40); // 24 bit SDR 444 Mode 0
	//adv7611_write(0x98, 0x03, 0x20); // 8-bit 4:2:2 DDR mode 2 (ITU-656 mode)
	//adv7611_write(0x98, 0x05, 0x28); // AV Codes Off
	adv7611_write(0x98, 0x05, 0x2E); // AV Codes Off
	adv7611_write(0x98, 0x06, 0xA6); // Invert VS,HS pins
	adv7611_write(0x98, 0x0B, 0x44); // Power up part
	adv7611_write(0x98, 0x0C, 0x42); // Power up part
	adv7611_write(0x98, 0x14, 0x7F); // Max Drive Strength
	adv7611_write(0x98, 0x15, 0x80); // Disable Tristate of Pins
	adv7611_write(0x98, 0x19, 0x83); // LLC DLL phase
	adv7611_write(0x98, 0x33, 0x40); // LLC DLL enable

	adv7611_write(0x98, 0x20, 0xF8); // Manually assert hot plug on port A
	//adv7611_write(0x80, 0x2A, 0x3F); // power down

	adv7611_write(0x44, 0xBA, 0x01); // Set HDMI FreeRun
	adv7611_write(0x64, 0x40, 0x81); // Disable HDCP 1.1 features

	adv7611_write(0x68, 0x9B, 0x03); // ADI recommended setting
	adv7611_write(0x68, 0xC1, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC2, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC3, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC4, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC5, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC6, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC7, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC8, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC9, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xCA, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xCB, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xCC, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0x00, 0x00); // Set HDMI Input Port A
	adv7611_write(0x68, 0x83, 0xFE); // Enable clock terminator for port A
	adv7611_write(0x68, 0x6F, 0x0C); // ADI recommended setting
	adv7611_write(0x68, 0x85, 0x1F); // ADI recommended setting
	adv7611_write(0x68, 0x87, 0x70); // ADI recommended setting
	adv7611_write(0x68, 0x8D, 0x04); // LFG
	adv7611_write(0x68, 0x8E, 0x1E); // HFG
	adv7611_write(0x68, 0x1A, 0x8A); // unmute audio
	adv7611_write(0x68, 0x57, 0xDA); // ADI recommended setting
	adv7611_write(0x68, 0x58, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0x03, 0x98); // DIS_I2C_ZERO_COMPR
	adv7611_write(0x68, 0x75, 0x10); // DDC drive strength
}

// HDMI PCM Audio ADV7611 ##
// 6-4a - 1920 x 1080p60, Any Color Space In (YCrCb 444 24bit from ADV761x) 
void adv7611_1920_1080P_60(void)
{
	//adv7611_write(0x98, 0xFF, 0x80); // I2C reset
	adv7611_write(0x98, 0x01, 0x06); // Prim_Mode =110b HDMI-GR
	adv7611_write(0x98, 0x02, 0xF5); // Auto CSC, YCrCb out, Set op_656 bit
	adv7611_write(0x98, 0x03, 0x40); // 24 bit SDR 444 Mode 0
	//adv7611_write(0x98, 0x03, 0x2A); // 12-bit 4:2:2 DDR mode 2 (ITU-656 mode)
	adv7611_write(0x98, 0x05, 0x28); // AV Codes Off
	adv7611_write(0x98, 0x06, 0xA6); // Invert VS,HS pins
	adv7611_write(0x98, 0x0B, 0x44); // Power up part
	adv7611_write(0x98, 0x0C, 0x42); // Power up part
	adv7611_write(0x98, 0x14, 0x7F); // Max Drive Strength
	adv7611_write(0x98, 0x15, 0x80); // Disable Tristate of Pins
	adv7611_write(0x98, 0x19, 0x83); // LLC DLL phase
	adv7611_write(0x98, 0x33, 0x40); // LLC DLL enable
	adv7611_write(0x44, 0xBA, 0x01); // Set HDMI FreeRun
	adv7611_write(0x64, 0x40, 0x81); // Disable HDCP 1.1 features
	adv7611_write(0x68, 0x9B, 0x03); // ADI recommended setting
	adv7611_write(0x68, 0xC1, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC2, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC3, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC4, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC5, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC6, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC7, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC8, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC9, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xCA, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xCB, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xCC, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0x00, 0x00); // Set HDMI Input Port A
	adv7611_write(0x68, 0x83, 0xFE); // Enable clock terminator for port A
	adv7611_write(0x68, 0x6F, 0x0C); // ADI recommended setting
	adv7611_write(0x68, 0x85, 0x1F); // ADI recommended setting
	adv7611_write(0x68, 0x87, 0x70); // ADI recommended setting
	adv7611_write(0x68, 0x8D, 0x04); // LFG
	adv7611_write(0x68, 0x8E, 0x1E); // HFG
	adv7611_write(0x68, 0x1A, 0x8A); // unmute audio
	adv7611_write(0x68, 0x57, 0xDA); // ADI recommended setting
	adv7611_write(0x68, 0x58, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0x03, 0x98); // DIS_I2C_ZERO_COMPR
	adv7611_write(0x68, 0x75, 0x10); // DDC drive strength
}

// 6-4b - 1920 x 1080p60, Any Color Space In (YCrCb 444 24bit from ADV761x)
void adv7611_1920_1080P_60_2(void)
{
	//adv7611_write(0x98, 0xFF, 0x80); // I2C reset
	adv7611_write(0x98, 0x01, 0x06); // Prim_Mode =110b HDMI-GR
	adv7611_write(0x98, 0x02, 0xF5); // Auto CSC, YCrCb out, Set op_656 bit
	adv7611_write(0x98, 0x03, 0x40); // 24 bit SDR 444 Mode 0
	//adv7611_write(0x98, 0x03, 0x2A); // 12-bit 4:2:2 DDR mode 2 (ITU-656 mode)
	adv7611_write(0x98, 0x05, 0x28); // AV Codes Off
	adv7611_write(0x98, 0x06, 0xA6); // Invert VS,HS pins
	adv7611_write(0x98, 0x0B, 0x44); // Power up part
	adv7611_write(0x98, 0x0C, 0x42); // Power up part
	adv7611_write(0x98, 0x14, 0x7F); // Max Drive Strength
	adv7611_write(0x98, 0x15, 0x80); // Disable Tristate of Pins
	adv7611_write(0x98, 0x19, 0x83); // LLC DLL phase
	adv7611_write(0x98, 0x33, 0x40); // LLC DLL enable
	adv7611_write(0x44, 0xBA, 0x01); // Set HDMI FreeRun
	adv7611_write(0x64, 0x40, 0x81); // Disable HDCP 1.1 features
	adv7611_write(0x68, 0x9B, 0x03); // ADI recommended setting
	adv7611_write(0x68, 0xC1, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC2, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC3, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC4, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC5, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC6, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC7, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC8, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC9, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xCA, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xCB, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xCC, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0x00, 0x00); // Set HDMI Input Port A
	adv7611_write(0x68, 0x83, 0xFE); // Enable clock terminator for port A
	adv7611_write(0x68, 0x6F, 0x0C); // ADI recommended setting
	adv7611_write(0x68, 0x85, 0x1F); // ADI recommended setting
	adv7611_write(0x68, 0x87, 0x70); // ADI recommended setting
	adv7611_write(0x68, 0x8D, 0x04); // LFG
	adv7611_write(0x68, 0x8E, 0x1E); // HFG
	adv7611_write(0x68, 0x1A, 0x8A); // unmute audio
	adv7611_write(0x68, 0x57, 0xDA); // ADI recommended setting
	adv7611_write(0x68, 0x58, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0x03, 0x98); // DIS_I2C_ZERO_COMPR
	adv7611_write(0x68, 0x75, 0x10); // DDC drive strength
}

// 6-4c - 1920 x 1080p60, Any Color Space In (YCrCb 444 24bit from ADV761x) 
void adv7611_1920_1080P_60_3(void)
{
	//adv7611_write(0x98, 0xFF, 0x80); // I2C reset
	adv7611_write(0x98, 0x01, 0x06); // Prim_Mode =110b HDMI-GR
	adv7611_write(0x98, 0x02, 0xF5); // Auto CSC, YCrCb out, Set op_656 bit
	adv7611_write(0x98, 0x03, 0x40); // 24 bit SDR 444 Mode 0
	//adv7611_write(0x98, 0x03, 0x2A); // 12-bit 4:2:2 DDR mode 2 (ITU-656 mode)
	adv7611_write(0x98, 0x05, 0x28); // AV Codes Off
	adv7611_write(0x98, 0x06, 0xA6); // Invert VS,HS pins
	adv7611_write(0x98, 0x0B, 0x44); // Power up part
	adv7611_write(0x98, 0x0C, 0x42); // Power up part
	adv7611_write(0x98, 0x14, 0x7F); // Max Drive Strength
	adv7611_write(0x98, 0x15, 0x80); // Disable Tristate of Pins
	adv7611_write(0x98, 0x19, 0x83); // LLC DLL phase
	adv7611_write(0x98, 0x33, 0x40); // LLC DLL enable
	adv7611_write(0x44, 0xBA, 0x01); // Set HDMI FreeRun
	adv7611_write(0x64, 0x40, 0x81); // Disable HDCP 1.1 features
	adv7611_write(0x68, 0x9B, 0x03); // ADI recommended setting
	adv7611_write(0x68, 0xC1, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC2, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC3, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC4, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC5, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC6, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC7, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC8, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xC9, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xCA, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xCB, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0xCC, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0x00, 0x00); // Set HDMI Input Port A
	adv7611_write(0x68, 0x83, 0xFE); // Enable clock terminator for port A
	adv7611_write(0x68, 0x6F, 0x0C); // ADI recommended setting
	adv7611_write(0x68, 0x85, 0x1F); // ADI recommended setting
	adv7611_write(0x68, 0x87, 0x70); // ADI recommended setting
	adv7611_write(0x68, 0x8D, 0x04); // LFG
	adv7611_write(0x68, 0x8E, 0x1E); // HFG
	adv7611_write(0x68, 0x1A, 0x8A); // unmute audio
	adv7611_write(0x68, 0x57, 0xDA); // ADI recommended setting
	adv7611_write(0x68, 0x58, 0x01); // ADI recommended setting
	adv7611_write(0x68, 0x03, 0x98); // DIS_I2C_ZERO_COMPR
	adv7611_write(0x68, 0x75, 0x10); // DDC drive strength
}


// ## EDID ##
// ADV7611 EDID 8 bit only NO DSD or HBR Support:
void adv7611_edid_8_bit(void)
{
	adv7611_write(0x64, 0x77, 0x00); // Disable the Internal EDID
	adv7611_write(0x6C, 0x00, 0x00); // 
	adv7611_write(0x6C, 0x01, 0xFF); // 
	adv7611_write(0x6C, 0x02, 0xFF); // 
	adv7611_write(0x6C, 0x03, 0xFF); // 
	adv7611_write(0x6C, 0x04, 0xFF); // 
	adv7611_write(0x6C, 0x05, 0xFF); // 
	adv7611_write(0x6C, 0x06, 0xFF); // 
	adv7611_write(0x6C, 0x07, 0x00); // 
	adv7611_write(0x6C, 0x08, 0x52); // 
	adv7611_write(0x6C, 0x09, 0x62); // 
	adv7611_write(0x6C, 0x0A, 0x88); // 
	adv7611_write(0x6C, 0x0B, 0x88); // 
	adv7611_write(0x6C, 0x0C, 0x00); // 
	adv7611_write(0x6C, 0x0D, 0x88); // 
	adv7611_write(0x6C, 0x0E, 0x88); // 
	adv7611_write(0x6C, 0x0F, 0x88); // 
	adv7611_write(0x6C, 0x10, 0x1C); // 
	adv7611_write(0x6C, 0x11, 0x15); // 
	adv7611_write(0x6C, 0x12, 0x01); // 
	adv7611_write(0x6C, 0x13, 0x03); // 
	adv7611_write(0x6C, 0x14, 0x80); // 
	adv7611_write(0x6C, 0x15, 0x00); // 
	adv7611_write(0x6C, 0x16, 0x00); // 
	adv7611_write(0x6C, 0x17, 0x78); // 
	adv7611_write(0x6C, 0x18, 0x0A); // 
	adv7611_write(0x6C, 0x19, 0x0D); // 
	adv7611_write(0x6C, 0x1A, 0xC9); // 
	adv7611_write(0x6C, 0x1B, 0xA0); // 
	adv7611_write(0x6C, 0x1C, 0x57); // 
	adv7611_write(0x6C, 0x1D, 0x47); // 
	adv7611_write(0x6C, 0x1E, 0x98); // 
	adv7611_write(0x6C, 0x1F, 0x27); // 
	adv7611_write(0x6C, 0x20, 0x12); // 
	adv7611_write(0x6C, 0x21, 0x48); // 
	adv7611_write(0x6C, 0x22, 0x4C); // 
	adv7611_write(0x6C, 0x23, 0x00); // 
	adv7611_write(0x6C, 0x24, 0x00); // 
	adv7611_write(0x6C, 0x25, 0x00); // 
	adv7611_write(0x6C, 0x26, 0x01); // 
	adv7611_write(0x6C, 0x27, 0x01); // 
	adv7611_write(0x6C, 0x28, 0x01); // 
	adv7611_write(0x6C, 0x29, 0x01); // 
	adv7611_write(0x6C, 0x2A, 0x01); // 
	adv7611_write(0x6C, 0x2B, 0x01); // 
	adv7611_write(0x6C, 0x2C, 0x01); // 
	adv7611_write(0x6C, 0x2D, 0x01); // 
	adv7611_write(0x6C, 0x2E, 0x01); // 
	adv7611_write(0x6C, 0x2F, 0x01); // 
	adv7611_write(0x6C, 0x30, 0x01); // 
	adv7611_write(0x6C, 0x31, 0x01); // 
	adv7611_write(0x6C, 0x32, 0x01); // 
	adv7611_write(0x6C, 0x33, 0x01); // 
	adv7611_write(0x6C, 0x34, 0x01); // 
	adv7611_write(0x6C, 0x35, 0x01); // 
	adv7611_write(0x6C, 0x36, 0x02); // 
	adv7611_write(0x6C, 0x37, 0x3A); // 
	adv7611_write(0x6C, 0x38, 0x80); // 
	adv7611_write(0x6C, 0x39, 0x18); // 
	adv7611_write(0x6C, 0x3A, 0x71); // 
	adv7611_write(0x6C, 0x3B, 0x38); // 
	adv7611_write(0x6C, 0x3C, 0x2D); // 
	adv7611_write(0x6C, 0x3D, 0x40); // 
	adv7611_write(0x6C, 0x3E, 0x58); // 
	adv7611_write(0x6C, 0x3F, 0x2C); // 
	adv7611_write(0x6C, 0x40, 0x45); // 
	adv7611_write(0x6C, 0x41, 0x00); // 
	adv7611_write(0x6C, 0x42, 0x00); // 
	adv7611_write(0x6C, 0x43, 0x38); // 
	adv7611_write(0x6C, 0x44, 0xF4); // 
	adv7611_write(0x6C, 0x45, 0x00); // 
	adv7611_write(0x6C, 0x46, 0x00); // 
	adv7611_write(0x6C, 0x47, 0x1E); // 
	adv7611_write(0x6C, 0x48, 0x02); // 
	adv7611_write(0x6C, 0x49, 0x3A); // 
	adv7611_write(0x6C, 0x4A, 0x80); // 
	adv7611_write(0x6C, 0x4B, 0x18); // 
	adv7611_write(0x6C, 0x4C, 0x71); // 
	adv7611_write(0x6C, 0x4D, 0x38); // 
	adv7611_write(0x6C, 0x4E, 0x2D); // 
	adv7611_write(0x6C, 0x4F, 0x40); // 
	adv7611_write(0x6C, 0x50, 0x58); // 
	adv7611_write(0x6C, 0x51, 0x2C); // 
	adv7611_write(0x6C, 0x52, 0x45); // 
	adv7611_write(0x6C, 0x53, 0x00); // 
	adv7611_write(0x6C, 0x54, 0x00); // 
	adv7611_write(0x6C, 0x55, 0x38); // 
	adv7611_write(0x6C, 0x56, 0xF4); // 
	adv7611_write(0x6C, 0x57, 0x00); // 
	adv7611_write(0x6C, 0x58, 0x00); // 
	adv7611_write(0x6C, 0x59, 0x1E); // 
	adv7611_write(0x6C, 0x5A, 0x00); // 
	adv7611_write(0x6C, 0x5B, 0x00); // 
	adv7611_write(0x6C, 0x5C, 0x00); // 
	adv7611_write(0x6C, 0x5D, 0xFC); // 
	adv7611_write(0x6C, 0x5E, 0x00); // 
	adv7611_write(0x6C, 0x5F, 0x48); // 
	adv7611_write(0x6C, 0x60, 0x69); // 
	adv7611_write(0x6C, 0x61, 0x67); // 
	adv7611_write(0x6C, 0x62, 0x68); // 
	adv7611_write(0x6C, 0x63, 0x67); // 
	adv7611_write(0x6C, 0x64, 0x6C); // 
	adv7611_write(0x6C, 0x65, 0x61); // 
	adv7611_write(0x6C, 0x66, 0x73); // 
	adv7611_write(0x6C, 0x67, 0x73); // 
	adv7611_write(0x6C, 0x68, 0x48); // 
	adv7611_write(0x6C, 0x69, 0x32); // 
	adv7611_write(0x6C, 0x6A, 0x2D); // 
	adv7611_write(0x6C, 0x6B, 0x31); // 
	adv7611_write(0x6C, 0x6C, 0x00); // 
	adv7611_write(0x6C, 0x6D, 0x00); // 
	adv7611_write(0x6C, 0x6E, 0x00); // 
	adv7611_write(0x6C, 0x6F, 0xFD); // 
	adv7611_write(0x6C, 0x70, 0x00); // 
	adv7611_write(0x6C, 0x71, 0x14); // 
	adv7611_write(0x6C, 0x72, 0x78); // 
	adv7611_write(0x6C, 0x73, 0x01); // 
	adv7611_write(0x6C, 0x74, 0xFF); // 
	adv7611_write(0x6C, 0x75, 0x1D); // 
	adv7611_write(0x6C, 0x76, 0x00); // 
	adv7611_write(0x6C, 0x77, 0x0A); // 
	adv7611_write(0x6C, 0x78, 0x20); // 
	adv7611_write(0x6C, 0x79, 0x20); // 
	adv7611_write(0x6C, 0x7A, 0x20); // 
	adv7611_write(0x6C, 0x7B, 0x20); // 
	adv7611_write(0x6C, 0x7C, 0x20); // 
	adv7611_write(0x6C, 0x7D, 0x20); // 
	adv7611_write(0x6C, 0x7E, 0x01); // 
	adv7611_write(0x6C, 0x7F, 0x11); // 
	adv7611_write(0x6C, 0x80, 0x02); // 
	adv7611_write(0x6C, 0x81, 0x03); // 
	adv7611_write(0x6C, 0x82, 0x1A); // 
	adv7611_write(0x6C, 0x83, 0x40); // 
	adv7611_write(0x6C, 0x84, 0x47); // 
	adv7611_write(0x6C, 0x85, 0x10); // 
	adv7611_write(0x6C, 0x86, 0x13); // 
	adv7611_write(0x6C, 0x87, 0x03); // 
	adv7611_write(0x6C, 0x88, 0x02); // 
	adv7611_write(0x6C, 0x89, 0x07); // 
	adv7611_write(0x6C, 0x8A, 0x06); // 
	adv7611_write(0x6C, 0x8B, 0x01); // 
	adv7611_write(0x6C, 0x8C, 0x23); // 
	adv7611_write(0x6C, 0x8D, 0x09); // 
	adv7611_write(0x6C, 0x8E, 0x07); // 
	adv7611_write(0x6C, 0x8F, 0x01); // 
	adv7611_write(0x6C, 0x90, 0x83); // 
	adv7611_write(0x6C, 0x91, 0x01); // 
	adv7611_write(0x6C, 0x92, 0x00); // 
	adv7611_write(0x6C, 0x93, 0x00); // 
	adv7611_write(0x6C, 0x94, 0x6C); // 
	adv7611_write(0x6C, 0x95, 0x03); // 
	adv7611_write(0x6C, 0x96, 0x0C); // 
	adv7611_write(0x6C, 0x97, 0x00); // 
	adv7611_write(0x6C, 0x98, 0x10); // 
	adv7611_write(0x6C, 0x99, 0x00); // 
	adv7611_write(0x6C, 0x9A, 0XB8); // 
	adv7611_write(0x6C, 0x9B, 0X2D); // 
	adv7611_write(0x6C, 0x9C, 0X20); // 
	adv7611_write(0x6C, 0x9D, 0XA0); // 
	adv7611_write(0x6C, 0x9E, 0X02); // 
	adv7611_write(0x6C, 0x9F, 0X01); // 
	adv7611_write(0x6C, 0xA0, 0X41); // 
	adv7611_write(0x6C, 0xA1, 0x02); // 
	adv7611_write(0x6C, 0xA2, 0x3A); // 
	adv7611_write(0x6C, 0xA3, 0x80); // 
	adv7611_write(0x6C, 0xA4, 0x18); // 
	adv7611_write(0x6C, 0xA5, 0x71); // 
	adv7611_write(0x6C, 0xA6, 0x38); // 
	adv7611_write(0x6C, 0xA7, 0x2D); // 
	adv7611_write(0x6C, 0xA8, 0x40); // 
	adv7611_write(0x6C, 0xA9, 0x58); // 
	adv7611_write(0x6C, 0xAA, 0x2C); // 
	adv7611_write(0x6C, 0xAB, 0x45); // 
	adv7611_write(0x6C, 0xAC, 0x00); // 
	adv7611_write(0x6C, 0xAD, 0x00); // 
	adv7611_write(0x6C, 0xAE, 0x38); // 
	adv7611_write(0x6C, 0xAF, 0xF4); // 
	adv7611_write(0x6C, 0xB0, 0x00); // 
	adv7611_write(0x6C, 0xB1, 0x00); // 
	adv7611_write(0x6C, 0xB2, 0x1E); // 
	adv7611_write(0x6C, 0xB3, 0x02); // 
	adv7611_write(0x6C, 0xB4, 0x3A); // 
	adv7611_write(0x6C, 0xB5, 0x80); // 
	adv7611_write(0x6C, 0xB6, 0x18); // 
	adv7611_write(0x6C, 0xB7, 0x71); // 
	adv7611_write(0x6C, 0xB8, 0x38); // 
	adv7611_write(0x6C, 0xB9, 0x2D); // 
	adv7611_write(0x6C, 0xBA, 0x40); // 
	adv7611_write(0x6C, 0xBB, 0x58); // 
	adv7611_write(0x6C, 0xBC, 0x2C); // 
	adv7611_write(0x6C, 0xBD, 0x45); // 
	adv7611_write(0x6C, 0xBE, 0x00); // 
	adv7611_write(0x6C, 0xBF, 0x00); // 
	adv7611_write(0x6C, 0xC0, 0x38); // 
	adv7611_write(0x6C, 0xC1, 0xF4); // 
	adv7611_write(0x6C, 0xC2, 0x00); // 
	adv7611_write(0x6C, 0xC3, 0x00); // 
	adv7611_write(0x6C, 0xC4, 0x1E); // 
	adv7611_write(0x6C, 0xC5, 0x02); // 
	adv7611_write(0x6C, 0xC6, 0x3A); // 
	adv7611_write(0x6C, 0xC7, 0x80); // 
	adv7611_write(0x6C, 0xC8, 0x18); // 
	adv7611_write(0x6C, 0xC9, 0x71); // 
	adv7611_write(0x6C, 0xCA, 0x38); // 
	adv7611_write(0x6C, 0xCB, 0x2D); // 
	adv7611_write(0x6C, 0xCC, 0x40); // 
	adv7611_write(0x6C, 0xCD, 0x58); // 
	adv7611_write(0x6C, 0xCE, 0x2C); // 
	adv7611_write(0x6C, 0xCF, 0x45); // 
	adv7611_write(0x6C, 0xD0, 0x00); // 
	adv7611_write(0x6C, 0xD1, 0x00); // 
	adv7611_write(0x6C, 0xD2, 0x38); // 
	adv7611_write(0x6C, 0xD3, 0xF4); // 
	adv7611_write(0x6C, 0xD4, 0x00); // 
	adv7611_write(0x6C, 0xD5, 0x00); // 
	adv7611_write(0x6C, 0xD6, 0x1E); // 
	adv7611_write(0x6C, 0xD7, 0x02); // 
	adv7611_write(0x6C, 0xD8, 0x3A); // 
	adv7611_write(0x6C, 0xD9, 0x80); // 
	adv7611_write(0x6C, 0xDA, 0x18); // 
	adv7611_write(0x6C, 0xDB, 0x71); // 
	adv7611_write(0x6C, 0xDC, 0x38); // 
	adv7611_write(0x6C, 0xDD, 0x2D); // 
	adv7611_write(0x6C, 0xDE, 0x40); // 
	adv7611_write(0x6C, 0xDF, 0x58); // 
	adv7611_write(0x6C, 0xE0, 0x2C); // 
	adv7611_write(0x6C, 0xE1, 0x45); // 
	adv7611_write(0x6C, 0xE2, 0x00); // 
	adv7611_write(0x6C, 0xE3, 0x00); // 
	adv7611_write(0x6C, 0xE4, 0x38); // 
	adv7611_write(0x6C, 0xE5, 0xF4); // 
	adv7611_write(0x6C, 0xE6, 0x00); // 
	adv7611_write(0x6C, 0xE7, 0x00); // 
	adv7611_write(0x6C, 0xE8, 0x1E); // 
	adv7611_write(0x6C, 0xE9, 0x00); // 
	adv7611_write(0x6C, 0xEA, 0x00); // 
	adv7611_write(0x6C, 0xEB, 0x00); // 
	adv7611_write(0x6C, 0xEC, 0x00); // 
	adv7611_write(0x6C, 0xED, 0x00); // 
	adv7611_write(0x6C, 0xEE, 0x00); // 
	adv7611_write(0x6C, 0xEF, 0x00); // 
	adv7611_write(0x6C, 0xF0, 0x00); // 
	adv7611_write(0x6C, 0xF1, 0x00); // 
	adv7611_write(0x6C, 0xF2, 0x00); // 
	adv7611_write(0x6C, 0xF3, 0x00); // 
	adv7611_write(0x6C, 0xF4, 0x00); // 
	adv7611_write(0x6C, 0xF5, 0x00); // 
	adv7611_write(0x6C, 0xF6, 0x00); // 
	adv7611_write(0x6C, 0xF7, 0x00); // 
	adv7611_write(0x6C, 0xF8, 0x00); // 
	adv7611_write(0x6C, 0xF9, 0x00); // 
	adv7611_write(0x6C, 0xFA, 0x00); // 
	adv7611_write(0x6C, 0xFB, 0x00); // 
	adv7611_write(0x6C, 0xFC, 0x00); // 
	adv7611_write(0x6C, 0xFD, 0x00); // 
	adv7611_write(0x6C, 0xFE, 0x00); // 
	adv7611_write(0x6C, 0xFF, 0x9C-0x41); // 
	adv7611_write(0x64, 0x77, 0x00); // Set the Most Significant Bit of the SPA location to 0
	adv7611_write(0x64, 0x52, 0x20); // Set the SPA for port B.
	adv7611_write(0x64, 0x53, 0x00); // Set the SPA for port B.
	adv7611_write(0x64, 0x70, 0x9E); // Set the Least Significant Byte of the SPA location
	adv7611_write(0x64, 0x74, 0x03); // Enable the Internal EDID for Ports
}

